home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wgdb-42.lha / wgdb-4.2 / configure < prev    next >
Text File  |  1992-09-11  |  20KB  |  704 lines

  1. #!/bin/sh
  2.  
  3. # Configuration script
  4. #   Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc.
  5.  
  6. #This file is part of GNU.
  7.  
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. # $Id: configure,v 1.59 1991/10/16 19:53:31 gnu Exp $
  21.  
  22. # Please email any bugs, comments, and/or additions to this file to:
  23. # configure@cygnus.com
  24.  
  25. #
  26. # Shell script to create proper links to machine-dependent files in
  27. # preparation for compilation.
  28. #
  29. # If configure succeeds, it leaves its status in config.status.
  30. # If configure fails after disturbing the status quo, 
  31. #     config.status is removed.
  32. #
  33.  
  34. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0 $argv; kill $$)
  35.  
  36. #set -e
  37.  
  38. remove=rm
  39. hard_link=ln
  40. symbolic_link='ln -s'
  41.  
  42. #for Test
  43. #remove="echo rm"
  44. #hard_link="echo ln"
  45. #symbolic_link="echo ln -s"
  46.  
  47. # clear some things potentially inherited from environment.
  48.  
  49. Makefile=Makefile
  50. Makefile_in=Makefile.in
  51. ansi=
  52. arguments=$*
  53. commontargets=
  54. configdirs=
  55. defaulttargets=
  56. destdir=
  57. fatal=
  58. hostsubdir=
  59. norecursion=
  60. objdir=
  61. objdiroption=
  62. progname=
  63. recurring=
  64. removing=
  65. srcdir=
  66. srctrigger=
  67. target=
  68. targets=
  69. targetsubdir=
  70. verbose=
  71.  
  72. for arg in $*;
  73. do
  74.     case ${arg} in
  75.     -ansi | +a*)
  76.         ansi=true
  77.         clib=clib
  78.         ;;
  79.     -destdir=* | +destdir=* | +destdi=* | +destd=* | +dest=* | +des=* | +de=* | +d=*)
  80.         destdir=`echo ${arg} | sed 's/[+-]d[a-z]*=//'`
  81.         ;;
  82.     -languages=* | +languages=* | +language=* | +languag=* \
  83.         | +langua=* | +langu=* | +lang=* | +lan=* | +la=* \
  84.         | +l=*)
  85.         languages="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`"
  86.         ;;
  87.     -gas | +g*)
  88.         gas=yes
  89.         ;;
  90.     -help | +h*)
  91.         fatal=true
  92.         ;;
  93.     -nfp | +nf*)
  94.         nfp=yes
  95.         ;;
  96.     -norecursion | +no*)
  97.         norecursion=true
  98.         ;;
  99.     -objdir=* | +objdir=* | +objdi=* | +objd=* | +obj=* | +ob=* | +o=*)
  100.         objdiroption=${arg}
  101.         objdir=`echo ${arg} | sed 's/[+-]o[a-z]*=//'`
  102.         ;;
  103.     -recurring | +recurring | +recurrin | +recurri | +recurr | +recur | +recu | +rec | +re)
  104.         recurring=true
  105.         ;;
  106.     -rm | +rm)
  107.         removing=${arg}
  108.         ;;
  109.     -site=* | +site=* | +sit=* | +si=*)
  110.         site=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
  111.         ;;
  112. #    -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=*)
  113. #        srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
  114. #        ;;
  115.     -subdirs | +su*)
  116.         subdirs=${arg}
  117.         ;;
  118.     -target=* | +target=* | +targe=* | +targ=* | +tar=* | +ta=*)
  119.         if [ -n "${targets}" ] ; then
  120.             subdirs="+subdirs"
  121.         fi
  122.  
  123.         newtargets="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`"
  124.         targets="${newtargets}"
  125.         ;;
  126.     -tmpdir=* | +tmpdir=* | +tmpdi=* | +tmpd=* | +tmp=* | +tm=*)
  127.         tmpdiroption=${arg}
  128.         TMPDIR=`echo ${arg} | sed 's/[+-]t[a-z]*=//'`
  129.         ;;
  130.     -v | -verbose | +v*)
  131.         verbose=${arg}
  132.         ;;
  133.     -* | +*)
  134.         (echo ;
  135.         echo "Unrecognized option: \"${arg}\"". ;
  136.         echo) 1>&2
  137.         fatal=true
  138.         ;;
  139.     *)
  140.         if [ -n "${hosts}" ] ; then
  141.             subdirs="+subdirs"
  142.         fi
  143.  
  144.         newhosts="${hosts} ${arg}"
  145.         hosts=${newhosts}
  146.         ;;
  147.     esac
  148. done
  149.  
  150. if [ -n "${verbose}" ] ; then
  151.     echo $0 $*
  152. fi
  153.  
  154. ## this is a little touchy and won't always work, but...
  155. ##
  156. ## if the argv[0] starts with a slash then it is an absolute name that can be
  157. ## used as is.
  158. ##
  159. ## otherwise, if argv[0] has no slash in it, we can assume that it is on the
  160. ## path.  Since PATH might include "." we also add `pwd` to the end of PATH.
  161. ##
  162. ## otherwise we prepend `pwd` to $0 and hope that will give us an absolute
  163. ## path.
  164. ##
  165.  
  166. if (echo $0 | grep '^/' > /dev/null) ; then
  167.     progname=$0
  168. else
  169.     if (echo $0 | grep '/' > /dev/null) ; then
  170.         progname=`pwd`/$0
  171.     else
  172.         progname=$0
  173.         PATH=$PATH:`pwd` ; export PATH
  174.     fi
  175. fi
  176.  
  177. configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
  178.  
  179. if ${configsub} none >/dev/null 2>&1 ; then
  180.     true
  181. else
  182.     echo '***' cannot find config.sub.
  183.     echo 1
  184. fi
  185.  
  186. # process host and target only if not removing.
  187. if [ -z "${removing}" -a -z "${fatal}" ] ; then
  188.     # Complain if an arg is missing
  189.     if [ -z "${hosts}" ] ; then
  190.         (echo ;
  191.         echo "configure: No HOST specified." ;
  192.         echo) 1>&2
  193.         fatal=true
  194.     fi
  195. fi
  196.  
  197. if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
  198.     (echo "Usage: configure HOST" ;
  199.     echo ;
  200.     echo "Options: [defaults in brackets]" ;
  201.     echo " +ansi        configure w/ANSI library. [no ansi lib]" ;
  202.     echo " +destdir=MYDIR    configure for installation into MYDIR. [\"/usr/local\"]" ;
  203.     echo " +gas        configure the compilers for use with gas. [native as]" ;
  204.     echo " +help        print this message. [normal config]" ;
  205.     echo " +lang=LANG    configure to build LANG. [gcc]" ;
  206.     echo " +nfp        configure the compilers default to soft floating point. [hard float]" ;
  207.     echo " +norecursion    configure this directory only. [recurse]" ;
  208.     echo " +objdir=ODIR    configure in a parallel tree rooted in ODIR. [rooted in \".\"]" ;
  209.     echo " +rm        remove this configuration. [build a configuration]" ;
  210.     echo " +site        configure with site specific makefile" ;
  211. # This is correctly aligned in the output, even though it isn't here.
  212.     echo " +subdirs    configure in subdirectories.  [in source directories]" ;
  213.     echo " +target=TARGET    configure for TARGET.  [TARGET = HOST]" ;
  214.     echo " +tmpdir=TMPDIR    create temporary files in TMPDIR.  [ TMPDIR = \"/tmp\" ]" ;
  215.     echo ;
  216.     echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
  217.     echo "Asking for more than one \"+target\" implies \"+subdirs\".  Any other" ;
  218.     echo "options given will apply to all targets.") 1>&2
  219.  
  220.     if [ -r config.status ] ; then
  221.         cat config.status
  222.     fi
  223.  
  224.     exit 1
  225. fi
  226.  
  227. ### break up configure.in.
  228. if [ -r configure.in ] ; then
  229.     if [ -z "`grep '^# per\-host:' configure.in`" ] ; then
  230.         echo '***' `pwd`/configure.in has no "per-host:" line. 1>&2
  231.         exit 1
  232.     fi
  233.  
  234.     if [ -z "`grep '^# per\-target:' configure.in`" ] ; then
  235.         echo '***' `pwd`/configure.in has no "per-target:" line. 1>&2
  236.         exit 1
  237.     fi
  238.  
  239.     if [ -z "${TMPDIR}" ] ; then
  240.         TMPDIR=/tmp ; export TMPDIR
  241.     fi
  242.  
  243.     # keep this filename short for &%*%$*# 14 char file names
  244.     tmpfile=${TMPDIR}/cONf$$
  245.  
  246.     # split configure.in into common, per-host, per-target,
  247.     # and post-target parts.  Post-target is optional.
  248.     sed -e '/^# per\-host:/,$d' configure.in > ${tmpfile}.com
  249.     sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.in > ${tmpfile}.hst
  250.     if grep '^# post-target:' configure.in >/dev/null ; then
  251.       sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' configure.in > ${tmpfile}.tgt
  252.       sed -e '1,/^# post\-target:/d' configure.in > ${tmpfile}.pos
  253.     else
  254.       sed -e '1,/^# per\-target:/d' configure.in > ${tmpfile}.tgt
  255.       echo >${tmpfile}.pos
  256.     fi
  257.  
  258. else
  259.     echo '***' No configure.in in `pwd`
  260.     exit 1
  261. fi
  262.  
  263. ### do common part of configure.in
  264.  
  265. . ${tmpfile}.com
  266.  
  267. # some sanity checks on configure.in
  268. if [ -z "${srctrigger}" ] ; then
  269.     echo '***' srctrigger not set in `pwd`/configure.in.
  270.     exit 1
  271. fi
  272.  
  273. for host in ${hosts} ; do
  274.     # Default other arg
  275.     if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then
  276.         targets=${host}
  277.         defaulttargets=true
  278.     fi
  279.  
  280.     host_alias=${host}
  281.  
  282.     result=`${configsub} ${host}`
  283.     host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  284.     host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  285.     host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  286.     host=${host_cpu}-${host_vendor}-${host_os}
  287.     host_makefile_frag=config/hmake-${host}
  288.  
  289.     . ${tmpfile}.hst
  290.  
  291.     for target in ${targets} ; do
  292.  
  293.         target_alias=${target}
  294.         result=`${configsub} ${target}`
  295.         target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  296.         target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  297.         target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  298.         target=${target_cpu}-${target_vendor}-${target_os}
  299.         target_makefile_frag=config/tmake-${target}
  300.  
  301.         . ${tmpfile}.tgt
  302.  
  303.         # Temporarily, we support only direct subdir builds.
  304.         hostsubdir=H-${host_alias}
  305.         targetsubdir=T-${target_alias}
  306.  
  307.         if [ -n "${removing}" ] ; then
  308.             if [ -n "${objdir}" ] ; then
  309.                 echo '***' +rm not supported for +objdir.  Just \"rm -rf ${objdir}\" by hand.
  310.                 exit 1
  311.             fi
  312.  
  313.             if [ -n "${subdirs}" ] ; then
  314.                 if [ -d "${hostsubdir}" ] ; then
  315.                     rm -rf ${hostsubdir}/${targetsubdir}
  316.  
  317.                     if [ -z "`(ls ${hostsubdir}) 2>&1 | grep T- | grep -v T-independent`" ] ; then
  318.                         rm -rf ${hostsubdir}
  319.                     fi
  320.                 else
  321.                     echo Warning: no `pwd`/${hostsubdir} to remove.
  322.                 fi
  323.             else
  324.                 rm -f ${Makefile} config.status ${links}
  325.             fi
  326.         else
  327.             if [ -n "${objdir}" ]; then
  328.                 srcdir=`pwd`
  329.                 cd ${objdir}
  330.             fi
  331.  
  332.             if [ -n "${subdirs}" ] ; then
  333.                 # check for existing status before allowing forced subdirs.
  334.                 if [ -f ${Makefile} ] ; then
  335.                     echo '***' "${Makefile} already exists in source directory.  `pwd` not configured." 1>&2
  336.                     exit 1
  337.                 fi
  338.  
  339.                 if [ ! -d ${hostsubdir} ] ; then mkdir ${hostsubdir} ; fi
  340.                 cd ${hostsubdir}
  341.  
  342.                 if [ ! -d ${targetsubdir} ] ; then
  343.                     if [ -z "${commontargets}" ] ; then
  344.                         mkdir ${targetsubdir}
  345.                     else
  346.                         if [ ! -d T-independent ] ; then
  347.                             mkdir T-independent
  348.                         fi
  349.  
  350.                         ${symbolic_link} T-independent ${targetsubdir}
  351.                     fi # if target independent
  352.                 fi # if no target dir yet
  353.  
  354.                 cd ${targetsubdir}
  355.  
  356.                 if [ -z "${srcdir}" ] ; then
  357.                     srcdir=../..
  358.                 fi
  359.             else
  360.                 # if not subdir builds, then make sure none exist.
  361.                 if [ -n "`(ls .) 2>&1 | (grep H- ; true)`" ] ; then
  362.                     echo '***' "Configured subdirs exist.  `pwd` not configured." 1>&2
  363.                     exit 1
  364.                 else
  365.                     true
  366.                 fi
  367.             fi
  368.  
  369.             # Find the source files, if location was not specified.
  370.             if [ -z "${srcdir}" ] ; then
  371.                 srcdirdefaulted=1
  372.                 srcdir=.
  373.                 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then
  374.                     srcdir=..
  375.                 fi
  376.             fi
  377.  
  378.             if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
  379.                 if [ -z "${srcdirdefaulted}" ] ; then
  380.                     echo '***' "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2
  381.                 else
  382.                     echo '***' "${progname}: Can't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2
  383.                 fi
  384.  
  385.                 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
  386.                 exit 1
  387.             fi
  388.  
  389.             # Set up the list of links to be made.
  390.             # ${links} is the list of link names, and ${files} is the list of names to link to.
  391.  
  392.             # Make the links.
  393.             while [ -n "${files}" ] ; do
  394.                 # set file to car of files, files to cdr of files
  395.                 set ${files}; file=$1; shift; files=$*
  396.                 set ${links}; link=$1; shift; links=$*
  397.  
  398.                 if [ ! -r ${srcdir}/${file} ] ; then
  399.                     echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
  400.                     echo '***' "since the file \"${file}\" does not exist." 1>&2
  401.                     exit 1
  402.                 fi
  403.  
  404.                 ${remove} -f ${link}
  405.                 rm -f config.status
  406.                 # Make a symlink if possible, otherwise try a hard link
  407.                 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
  408.  
  409.                 if [ ! -r ${link} ] ; then
  410.                     echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
  411.                     exit 1
  412.                 fi
  413.  
  414.                 if [ -n "${verbose}" ] ; then
  415.                     echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
  416.                 fi
  417.             done
  418.  
  419.             # Create a .gdbinit file which runs the one in srcdir
  420.             # and tells GDB to look there for source files.
  421.  
  422.             case ${srcdir} in
  423.             .)
  424.                 ;;
  425.             *)
  426.                 echo "dir ." > .gdbinit
  427.                 echo "dir ${srcdir}" >> .gdbinit
  428.                 echo "source ${srcdir}/.gdbinit" >> .gdbinit
  429.                 ;;
  430.             esac
  431.  
  432.             # Install a makefile, and make it set VPATH
  433.             # if necessary so that the sources are found.
  434.             # Also change its value of srcdir.
  435.  
  436.         # FIXME-someday: This business of always writing to .tem and mv back
  437.         # is so that I don't screw things up while developing.  Once this
  438.         # template is stable, these should be optimized. xoxorich.
  439.  
  440.             # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
  441.             if [ "${host}" != "${target}" ] ; then
  442.                 echo "CROSS=-DCROSS_COMPILE" > ${Makefile}
  443.                 echo "ALL=start.encap" >> ${Makefile}
  444.             else
  445.                 echo "ALL=all.internal" > ${Makefile}
  446.             fi
  447.  
  448.             # set target, host, VPATH
  449.             echo "host_alias = ${host_alias}" >> ${Makefile}
  450.             echo "host_cpu = ${host_cpu}" >> ${Makefile}
  451.             echo "host_vendor = ${host_vendor}" >> ${Makefile}
  452.             echo "host_os = ${host_os}" >> ${Makefile}
  453.  
  454.             echo "target_alias = ${target_alias}" >> ${Makefile}
  455.             echo "target_cpu = ${target_cpu}" >> ${Makefile}
  456.             echo "target_vendor = ${target_vendor}" >> ${Makefile}
  457.             echo "target_os = ${target_os}" >> ${Makefile}
  458.  
  459.             if [ -n "${subdirs}" ] ; then
  460.                 (echo "subdir = /${hostsubdir}/${targetsubdir}" ;
  461.                     echo "unsubdir = ../..") >> ${Makefile}
  462.             else
  463.                 (echo "subdir =" ;
  464.                     echo "unsubdir = .") >> ${Makefile}
  465.             fi
  466.  
  467.         #    echo "workdir = `pwd`" >> ${Makefile}
  468.             echo "VPATH = ${srcdir}" >> ${Makefile}
  469.  
  470.             # add "Makefile.in" (or whatever it's called)
  471.             cat ${srcdir}/${Makefile_in} >> ${Makefile}
  472.  
  473.             # Conditionalize the makefile for this host.
  474.             if [ -f ${srcdir}/${host_makefile_frag} ] ; then
  475.                 (echo "host_makefile_frag = ${srcdir}/${host_makefile_frag}" ; 
  476.                     sed -e "/^####/  r ${srcdir}/${host_makefile_frag}" ${Makefile}) > Makefile.tem
  477.                 mv Makefile.tem ${Makefile}
  478.             fi
  479.  
  480.             # Conditionalize the makefile for this target.
  481.             if [ -f ${srcdir}/${target_makefile_frag} ] ; then
  482.                 (echo "target_makefile_frag = ${srcdir}/${target_makefile_frag}" ; 
  483.                     sed -e "/^####/  r ${srcdir}/${target_makefile_frag}" ${Makefile}) > Makefile.tem
  484.                 mv Makefile.tem ${Makefile}
  485.             fi
  486.  
  487.             # Conditionalize the makefile for this site.
  488.             if [ -n "${site}" ] ; then
  489.                 site_makefile_frag=smake-${site}
  490.  
  491.                 if [ -f ${srcdir}/${site_makefile_frag} ] ; then
  492.                     (echo "site_makefile_frag = ${srcdir}/${site_makefile_frag}" ; 
  493.                         sed -e "/^####/  r ${srcdir}/${site_makefile_frag}" ${Makefile}) > Makefile.tem
  494.                     mv Makefile.tem ${Makefile}
  495.                 fi
  496.             fi
  497.  
  498.             # set srcdir
  499.             sed "s@^srcdir = \.@srcdir = ${srcdir}@" ${Makefile} > Makefile.tem
  500.             mv Makefile.tem ${Makefile}
  501.  
  502.             # set destdir
  503.             if [ -n "${destdir}" ] ; then
  504.                 sed "s:^destdir =.*$:destdir = ${destdir}:" ${Makefile} > Makefile.tem
  505.                 mv Makefile.tem ${Makefile}
  506.             fi
  507.  
  508.             # reset SUBDIRS
  509.             sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" ${Makefile} > Makefile.tem
  510.             mv Makefile.tem ${Makefile}
  511.  
  512.             # reset NONSUBDIRS
  513.             sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" ${Makefile} > Makefile.tem
  514.             mv Makefile.tem ${Makefile}
  515.  
  516.             # remove any form feeds.
  517.             sed -e "s/ //" ${Makefile} > Makefile.tem
  518.             mv Makefile.tem ${Makefile}
  519.  
  520.             using=
  521.             if [ -f ${srcdir}/${host_makefile_frag} ] ; then
  522.                 using="${using} and \"${host_makefile_frag}\""
  523.             fi
  524.             if [ -f ${srcdir}/${target_makefile_frag} ] ; then
  525.                 using="${using} and \"${target_makefile_frag}\""
  526.             fi
  527.             if [ -n "${site}" -a \
  528.                  -f ${srcdir}/${site_makefile_frag} ] ; then
  529.                 using="${using} and \"${site_makefile_frag}\""
  530.             fi
  531.             using=`echo "${using}" | sed 's/and/using/'`
  532.             using="Created \"${Makefile}\" in `pwd`${using}."
  533.  
  534.             if [ -n "${verbose}" -o -z "${recurring}" ] ; then
  535.                 echo ${using}
  536.             fi
  537.  
  538.             . ${tmpfile}.pos
  539.  
  540.             # describe the chosen configuration in config.status.
  541.             # Make that file a shellscript which will reestablish
  542.             # the same configuration.  Used in Makefiles to rebuild
  543.             # Makefiles.
  544.  
  545.             echo "#!/bin/sh
  546. # `pwd` was configured as follows:
  547. (cd ${srcdir} ; ${progname}" ${arguments} `if [ -z "${norecursion}" ] ; then echo +norecursion ; else true ; fi` ")
  548. # ${using}" > config.status
  549.             chmod a+x config.status
  550.  
  551.             originaldir=`pwd`
  552.             cd ${srcdir}
  553.         fi
  554.  
  555.         # If there are subdirectories, then recurse. 
  556.         if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then 
  557.             for configdir in ${configdirs} ; do
  558.                 if [ -n "${verbose}" ] ; then
  559.                     echo Configuring ${configdir}...
  560.                 fi
  561.  
  562.                 if [ -d ${configdir} ] ; then
  563.                     if [ -n "${objdir}" ] ; then
  564.                         if [ ! -d ${objdir}/${configdir} ] ; then
  565.                             mkdir ${objdir}/${configdir}
  566.                         fi
  567.                     fi
  568.  
  569.                     POPDIR=`pwd`
  570.                     cd ${configdir} 
  571.  
  572.                     if (${progname} +recurring ${host_alias} +target=${target_alias} \
  573.                         ${verbose} ${subdirs} ${removing} +destdir=${destdir} \
  574.                         `if [ -n "${objdir}" ] ; then echo +objdir=${objdir}/${configdir} ; fi` \
  575.                         ${tmpdiroption}) ; then
  576.                         true
  577.                     else
  578.                         exit 1
  579.                     fi
  580.  
  581.                     cd ${POPDIR}
  582.  
  583. #                    (cd ${configdir} ;
  584. #                        if (${progname} +recurring ${host_alias} +target=${target_alias} \
  585. #                            ${verbose} ${subdirs} ${removing} +destdir=${destdir} \
  586. #                            `if [ -n "${objdir}" ] ; then echo +objdir=${objdir}/${configdir} ; fi` \
  587. #                            ${tmpdiroption}) ; then true ; else exit 1 ; fi) \
  588. #                        | sed 's/^/    /'
  589.                 else
  590.                     if [ -n "${verbose}" ] ; then
  591.                         echo Warning: directory \"${configdir}\" is missing.
  592.                     fi
  593.                 fi
  594.             done
  595.         fi
  596.     done # for each target
  597.  
  598.     # Now build a Makefile for this host.
  599.     if [ -n "${subdirs}" -a ! -n "${removing}" ] ; then
  600.         push=`pwd`
  601.  
  602.         if [ -n "${objdir}" ] ; then
  603.             cd ${objdir}
  604.         fi
  605.  
  606.         cd ${hostsubdir}
  607.         cat > GNUmakefile << 'E!O!F'
  608. # Makefile generated by configure for host ${host_alias}.
  609.  
  610. ALL := $(shell ls -d T-*)
  611.  
  612. %:
  613.     $(foreach subdir,$(ALL),$(MAKE) -C $(subdir) \$@ &&) true
  614.  
  615. all:
  616. E!O!F
  617.         cd ${push}
  618.     fi
  619. done # for each host
  620.  
  621. ### clean up.
  622.  
  623. rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
  624.  
  625. exit 0
  626.  
  627. #
  628. #
  629. # $Log: configure,v $
  630. # Revision 1.59  1991/10/16  19:53:31  gnu
  631. # Update for SCO problems.
  632. #
  633. # * Fix "Larry Wall kludge" line so it works.  If this script is run by csh,
  634. # it will complain, feed itself to sh, and complain some more.  But will work.
  635. #
  636. # * Use <14 char file names in /tmp.
  637. #
  638. # Revision 1.58  1991/10/16  06:12:52  rich
  639. # Two small bugs.  First, single quoted sed line doesn't need to quote
  640. # '$'.  Second, use quotes around the hereis document trigger in order
  641. # to quote the entire contents of the hereis document.
  642. #
  643. # Revision 1.57  1991/10/11  05:31:05  gnu
  644. # Simplify "Using" message code.  Put the message that configure prints
  645. # (or suppresses) into the config.status file as a comment.
  646. #
  647. # Revision 1.56  1991/10/10  05:01:47  rich
  648. # Remove the set -e but protect the recusion call.
  649. #
  650. # Revision 1.55  1991/10/10  04:57:23  rich
  651. # * Die when sub-configure's do.
  652. # * get the makefile building message line correct.
  653. # * set -e
  654. #
  655. # Revision 1.54  1991/10/10  01:04:42  rich
  656. # Backed out the "/bin/sh config.sub" change.  Fails when config.sub was
  657. # on PATH.
  658. #
  659. # Revision 1.53  1991/10/10  00:38:08  rich
  660. # Call config.sub as "/bin/sh config.sub" instead of directly.  This
  661. # protects us from the case where config.sub isn't executable.
  662. #
  663. # Revision 1.52  1991/10/09  00:48:26  rich
  664. # Another patch from jim.
  665. #
  666. # Revision 1.51  1991/10/08  06:07:58  wilson
  667. # Fix bug in smake- file code.
  668. #
  669. # Revision 1.50  1991/10/04  23:49:37  rich
  670. # Per's patch for my config.sub botch.
  671. #
  672. # Revision 1.49  1991/10/04  22:52:09  rich
  673. # Use john's heuristic for finding ourselves.  kinda like hare krishna.
  674. #
  675. # Revision 1.48  1991/10/02  13:17:28  rich
  676. # take out the set -e for now
  677. #
  678. # Revision 1.47  1991/10/02  10:02:23  rich
  679. # * temporary files in TMPDIR
  680. # * +objdir
  681. #
  682. # Revision 1.46  1991/10/02  06:29:53  rich
  683. # Added +site=foo option for naming site specific Makefile fragments.
  684. #
  685. # Revision 1.45  1991/10/02  06:15:13  rich
  686. # Removed +f option.  Used to stand for +forcesubdirs which is now
  687. # called +subdirs.
  688. #
  689. # Revision 1.44  1991/10/02  06:02:35  rich
  690. # Added rcs log line.
  691. #
  692. #
  693. #
  694.  
  695. #
  696. # Local Variables:
  697. # fill-column: 131
  698. # End:
  699. #
  700.  
  701. # end of configure
  702.